#ifndef EXCHANGE_SHAPE_H
#define EXCHANGE_SHAPE_H

#pragma once

#include <vector>
#include <string>

namespace  AMCAX::Exchange {

class ExchangeTopoShape ;
class ExchangeMaterials ;

/// @ingroup Exchange
/// @brief Defines the information of the model, including the topology and some materal details.
/// 
class  ExchangeObject
{
    
public:
    ExchangeObject(std::string outShapeId ):id(outShapeId){
        this->sortId = 0;
    } ;
    /// @brief  Under Exchange ,there may be many sub-Exchanges mounted,This is used to add sub-Exchanges.
    /// 
    /// @param[in] child: The sub-Exchange to be added
    /// @param[out] NONE
    /// @return  NONE
    /// @retval NONE
    /// @note NONE
    /// @see NONE
    void AddChild(std::shared_ptr<ExchangeObject> child) 
    {
        this->childs.push_back(child) ;
    };
public:
    /// The information of the topology
    std::shared_ptr<ExchangeTopoShape> shape{nullptr} ;
    /// The name of the model
    std::string name ;
    /// The information of the sub-object
    std::vector<std::shared_ptr<ExchangeObject>> childs ;
    /// The information of the material
    std::shared_ptr<ExchangeMaterials> materials{nullptr} ;
    
    /// The persistent id. step files do not contain IDs,so we need to generate them during import. 
    std::string id ; 
    /// NOTE: GeomBox（Empty nodes in step files are generally of this type）, Part::Feature(Non-Empty nodes in step files are generally based on th "Part" prefix), etc.
    std::string type ; 

    /// The visibility indicator of the model 
    bool visibility = true;
    /// NOTE: 特征操作用的，如圆角基于那个方块做的 ，则base_id为该方块的id
    /// If it is a feature, the baseId is the id of the base shape.
    std::string baseId ;
    /// NOTE: CAD特征的关联关系，圆角特征是从方块创建的。prelink指向方块的信息。这个特征生成可能依赖多个特征
    /// NOTE: 参数化建模，每一步都要重建，所以依赖这个,用于重建 -> 利用有向无环图
    /// If it is a feature, this refers to the feature informatiion that was relied upon when generating the feature.
    std::vector<std::string> prelinks ;
    // NOTE: 某个特征被那些特征依赖过
    // NOTE: 参数化建模，每一步都要重建，所以依赖这个,用于重建 -> 利用有向无环图
    /// If it is a feature , this refers to the features that rely on the current feature.
    std::vector<std::string> outlinks ;
    
    /// Primarily used for sorting.
    int sortId;
} ;
}

#endif // EXCHANGE_SHAPE_H